package com.baitiaojun.common.exception;

import com.baitiaojun.common.enums.Enums;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 用户业务或自定义系统异常用此类构建异常枚举
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ErrorCode {

    private Integer code;

    private String message;

    public ErrorCode(Enums enums) {
        this.code = enums.getCode();
        this.message = enums.getName();
    }
}
